package OIandFile;

import java.io.File;

public class DeleteFile {
    public static void main(String[] args) {
        delte(new File("E:\\wuaoyu"));

    }
    public static void  delte(File file){
        if (file == null||!file.exists()) {
            return;
        }
        final File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()) {
                file1.delete();
            }
            if (file1.isDirectory()){
                delte(file1);

            }


        }
        delte(file);
    }
}
